package com.difsonapps.android.marker.adapters;

import com.difsonapps.android.marker.beans.User;
import com.difsonapps.android.marker.fragments.ProfileFragment;
import com.difsonapps.android.marker.fragments.ProfileInfosFragment;

import android.os.Bundle;
import android.app.Fragment;
import android.app.FragmentManager;
import android.support.v13.app.FragmentPagerAdapter;

public class ProfilePagerAdapter extends FragmentPagerAdapter {
	public ProfilePagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int i) {
    	User user = new User();
    	user.setFirstname("Franklin "+(i+1));
        Fragment fragment = new ProfileInfosFragment();
        Bundle args = new Bundle();
        // Our object is just an integer :-P
        args.putParcelable(ProfileInfosFragment.ARG_PARAM_USER, user);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public int getCount() {
        return 3;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return "User " + (position + 1);
    }
}
